<template>
  <div class="index-container whitebg">
    <!-- <van-nav-bar fixed title="查看详情" left-arrow @click-left='goBack'></van-nav-bar> -->
    <div class="header_active">
      <img src="@/assets/images/orderheader.png" alt="" class='headerimage'>
      <div class="header_title f_16">查看详情</div>
    </div>
    <div class="list_center flexrowbetween">
        <div class="flexcenter full_w itembox">
            <div class="item_flex flexcolumn">
                <img src="@/assets/images/icon_1.png" alt="">
                <span class="f_13">申请成功</span>
                <span class="f_10 timeout left20">{{detaildata.create_time}}</span>
            </div>
            <div class="rowline" :class="detaildata.status==0||detaildata.status==1||detaildata.status==4?'bg_000':''"></div>
            <div class="item_flex flexcolumn">
                <img :src="detaildata.status==0||detaildata.status==1||detaildata.status==4?require('@/assets/images/icon_3.png'):require('@/assets/images/icon_2.png')" alt="">
                <span class="f_13 c_8e8e" :class="detaildata.status==0||detaildata.status==1||detaildata.status==4?'c_000':''">审核中</span>
                <!-- <span class="f_10 timeout">{{detaildata.last_time}}</span> -->
                <span class="f_10 timeout" v-if="detaildata.status==1||detaildata.status==4">{{detaildata.last_time}}</span>
                <span class="f_10 timeout" v-else>-</span>
            </div>
            <div class="rowline" :class="detaildata.status==1||detaildata.status==4?'bg_000':''"></div>
            <div class="item_flex flexcolumn">
                <template v-if="detaildata.status==1">
                    <img src="@/assets/images/icon_1.png" alt="">
                    <span class="f_13 c_000">已通过</span>
                    <span class="f_10 timeout c_000 overflowtext">{{detaildata.msg}}</span>
                </template>
                <template v-else-if="detaildata.status==4">
                    <img src="@/assets/images/icon_4.png" alt="">
                    <span class="f_13 c_000">未通过</span>
                    <span class="f_10 timeout c_000 overflowtext right20">{{detaildata.msg}}</span>
                </template>
                <template v-else>
                    <img src="@/assets/images/icon_3.png" alt="">
                    <span class="f_13 c_8e8e">预计时间</span>
                    <span class="f_10 timeout right20">明天18:00前到账</span>
                    
                </template>
            </div>
        </div>
    </div>
    <div class="detail_body">
        <div class="flexrowbetween itemuser">
            <span class="user_title">用户名：</span>
            <span class="user_info">{{detaildata.userinfo?detaildata.userinfo.name:'-'}}</span>
        </div>
        <div class="flexrowbetween itemuser">
            <span class="user_title">入款账户：</span>
            <span class="user_info">{{detaildata.userinfo?detaildata.userinfo.pay_type_name:'-'}}</span>
        </div>
        <div class="flexrowbetween itemuser">
            <span class="user_title">支付账号：</span>
            <span class="user_info">{{detaildata.userinfo?detaildata.userinfo.account:'-'}}</span>
        </div>
        <div class="flexrowbetween itemuser">
            <span class="user_title">状态：</span>
            <span class="user_info">{{detaildata.status_name}}</span>
        </div>
        <div class="flexrowbetween itemuser">
            <span class="user_title">创建时间：</span>
            <span class="user_info">{{detaildata.create_time}}</span>
        </div>
        <div class="flexrowbetween itemuser">
          <span class="user_title">消息备注：</span>
          <span class="user_info">{{detaildata.msg}}</span>
        </div>
    </div>
  </div>
</template>

<script>
import { levelName } from '@/api/datalist';
import { getTxDetail } from '@/api/task';
export default {
  data() {
    return {
      loading:false,
      detaildata:{}
    }
  },

  created(){
    this.detailId = this.$route.query.id;
    this.getData();
  },

  methods: {

    getData(){
      getTxDetail({id:this.detailId}).then(res=>{
        if(res.code == 1){
            this.detaildata = res.data;
            // this.detaildata.level_name = levelName(res.data.active_level)
        }
      })
    },
    
    goPage(page){
      this.$router.push({name:page})
    },

    goBack(){
        this.$router.back();
    },


  }
}
</script>

<style lang="scss" scoped>
.index-container {
  width: 100%;
  min-height: 100vh;
  // background:url("~@/assets/images/activebg.png") center no-repeat;
  // background-size: cover;
  // position: relative;
}
.header_active{
  height: 208px;
  width: 100%;
  background: #EC865C;
}
.activebody{
  width: 100%;
  padding: 30px;
  padding-bottom: 0;
  min-height: calc(100vh - 360px);
}
.headerimage{
  width: 100%;
  height: 100%;
}
.header_title{
  width: 100%;
  position: absolute;
  top: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
}
.list_center{
  width: 95%;
  height: 200px;
  background: url("~@/assets/images/detail_header.png");
  background-size: 100% 100%;
//   background: linear-gradient(45deg, #FDAF8D 0%, #FC5F68 100%);;
  margin: 0 auto;
  margin-top: -80px;
  // z-index: 22;
  position: relative;
  border-radius: 10px;
}
.rowline{
    flex: 1;
    height: 1px;
    background-color: #707070;
}
.itembox{
    height: 200px;
    padding: 30px 20px;
    padding-bottom: 50px;
}
.item_flex{
    position: relative;
    width: 25%;
    align-items: center;
    img{
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
    .timeout{
        position: absolute;
        bottom: -30px;
        left: -20px;
        right: -40px;
        text-align: center;
        color: #8E8E8E;
    }
    .left20{
        left: 0;
        right: -60px;
    }
    .right20{
        right: -10px;
    }
}
.detail_body{
    width: 90%;
    margin: 0 auto;
    margin-top: 26px;
    background-color: #F8F8F8;
    padding: 26px;
    font-size: 24px;
}
.user_title{
    width: 130px;
    display: inline-block;
    color: #000;
}
.user_info{
    display: inline-block;
    color: #8E8E8E;
    max-width: calc(100% - 130px);
    word-break:break-all
    // overflow: hidden;
    // text-overflow: ellipsis;
}
.itemuser{
    margin-bottom: 30px;
    align-items:flex-start
}
</style>